<template>
	<view>
		<uni-search-bar placeholder="搜索" @confirm="shou"></uni-search-bar>
		<uni-card :title="reactive.company.name" extra="投诉">
			<image :src="base+reactive.company.imgUrl" mode="aspectFit"></image>
		</uni-card>

		<uni-group title="物流信息">
			<u-steps v-if="falg" :list="numList" mode="dot" direction="column"></u-steps>
		</uni-group>

		<view class="" style="height: 20vh;">

		</view>
		<view style="position: absolute;bottom: 0%;right:0%;left: 0%;padding: 20rpx;">
			<button type="primary" @click="CD">投诉</button>
		</view>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base: api.baseurl,
				reactive: '',
				numList: [],
				falg:true,
			}
		},
		onLoad(options) {
			this.getdan(options.order)
		},
		methods: {
			CD() {
				uni.navigateTo({
					url: './tous'
				})
			},
			shou(e) {
				var str = e.value.replace(/\s*/g, '')
				this.getdan(str)
			},
			getdan(value) {
				this.$get(this.base + '/prod-api/api/logistics-inquiry/logistics_info/' + value).then((res) => {
					if (res.code == 200) {
						this.reactive = res.data
						res.data.stepList.forEach((item) => {
							this.falg = false
							this.numList.push({
								name: item.addressAt
							})
							this.falg = true
						})
						
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})


			},
		}
	}
</script>

<style>

</style>
